package com.leyou.user.web;

import com.leyou.auth.utils.UserContext;
import com.leyou.user.dto.AddressDTO;
import org.springframework.http.ResponseEntity;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

@RestController
@RequestMapping("/address")
public class AddressController {
    @GetMapping
    public ResponseEntity<AddressDTO> findAddress(
            @RequestParam("userId")Long userId,@RequestParam("id")Long id){
        AddressDTO addressDTO = new AddressDTO();

        addressDTO.setId(id);
        addressDTO.setUserId(userId);
        addressDTO.setAddressee("张无忌");
        addressDTO.setPhone("15800000000");
        addressDTO.setProvince("上海");
        addressDTO.setCity("上海");
        addressDTO.setDistrict("浦东新区");
        addressDTO.setStreet("航头镇航头路18号传智播客3号楼");
        addressDTO.setPostcode("403400");
        addressDTO.setIsDefault(true);

        return ResponseEntity.ok(addressDTO);
    }
}
